// 导入
const joi = require('joi');

const title = joi.string().required();
const content = joi.string().required().allow('');
const pub_state = joi.number().integer().required();
const pub_time = joi.date().required();
const author_id = joi.number().integer().min(1).required();
const cate_id = joi.number().integer().min(1).required();

// 定义文章的验证规则
exports.articlesSchema ={
  title,
  content,
  pub_state,
  pub_time,
  author_id,
  cate_id
}